<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\models\Land;
use app\models\Equiptype;
use app\models\Park;

/* @var $this yii\web\View */
/* @var $model app\models\Equip */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="equip-form">

    <?php $form = ActiveForm::begin(); ?>

    <!--?= $form->field($model, 'code')->textInput(['maxlength' => true, 'disabled' => 'disabled']) ?-->

    <?php

        echo  $form->field($model, 'park_id')->dropdownlist(
            Park::find()->select(['name'])->indexBy('id')->column(),
            ['prompt' => '选择所属园区']);

        echo  $form->field($model, 'land_id')->dropdownlist(
            Land::find()->select(['name'])->indexBy('id')->column(),
            ['prompt' => '选择所属地块']);

        echo  $form->field($model, 'equip_type_id')->dropdownlist(
            equipType::find()->select(['name_ch'])->indexBy('id')->column(),
            ['prompt' => '选择设备类型']);

    ?>

    <?= $form->field($model, 'comment')->textInput(['maxlength' => true]) ?>

    <!--?//= $form->field($model, 'is_delete')->textInput() ?>-->

    <!--?//= $form->field($model, 'delete_time')->textInput() ?>-->


    <!--?= $form->field($model, 'equip_type_id')->textInput() ?-->

    <!--?= $form->field($model, 'park_id')->textInput() ?-->

    <!--?//= $form->field($model, 'land_id')->textInput() ?-->

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '添加' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
